<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>Document</title>
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="./css/font.css">
		<link rel="stylesheet" href="./css/xadmin.css">
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script src="./lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="./js/Global.js"></script>
		<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
		<style>
			.wrap {
				padding: 20px;
				width: 100%;
				overflow: auto;
				box-sizing: border-box;
			}
			
			ul {
				width: 100%;
			}
			
			ul li {
				width: 25%;
				float: left;
				height: 36px;
				line-height: 36px;
				/* background: #ccc; */
				text-align: center;
				box-sizing: border-box;
				border: 1px solid #ccc;
				border-top: 0px;
				cursor: pointer;
			}
			
			ul li:first-of-type {
				border: 1px solid #ccc;
			}
			
			ul li:nth-of-type(2) {
				border: 1px solid #ccc;
				border-left: 0px;
			}
			
			ul li:nth-of-type(3) {
				border: 1px solid #ccc;
				border-left: 0px;
			}
			
			ul li:nth-of-type(4) {
				border: 1px solid #ccc;
				border-left: 0px;
			}
			
			.winbody {
				width: 720px;
				padding: 10px;
			}
			
			.carlist {
				width: 120px;
				height: 30px;
				line-height: 30px;
				text-align: center;
				font-size: 14px;
				display: inline-block;
			}
			
			.tabs {
				/* width: 900px; */
			}
			
			.tabs a {
				width: 120px;
				height: 30px;
				line-height: 30px;
				text-align: center;
				font-size: 14px;
				display: inline-block;
			}
		</style>
	</head>

	<body>
		<div class="wrap">
			<ul id="list">

			</ul>
		</div>
		<div class="winbody" style="display:none;">
			<div class="lists">
			</div>
		</div>
	</body>
	<script>
		function seeInfo(id) {

			$.ajax({
				url: API+'/erpManagement/gojianceweihuCar?custId=' + id,
				type: 'get',
				dataType: 'json',
				success: function(ret) {
					var objkacha = ret.data.putongche
					var objdagua = ret.data.guache;
					var html = '';
					console.log(objkacha)
					for(var key in objkacha) {
						html += '<a href="cheliangwuliaoxiangqing.html?userid='+loadUserInfo.user.id+'&id=' + objkacha[key].id + '" class="carlist">' + objkacha[key].carPlate + '</a>';
					}
					for(var key in objdagua) {
						html += '<a href="cheliangwuliaoxiangqing.html?userid='+loadUserInfo.user.id+'&id=' + objdagua[key].id + '" class="carlist">' + objdagua[key].carPlate + '</a>';
					}
					$(".lists").html(html);
				},
				error: function(err) {
					alert("系统错误");
				}
			});
			layui.use('layer', function() {
				let layer = layui.layer;
				layer.open({
					type: 1,
					area: ['740px', '200px'],
					title: '车辆牌号',
					content: $('.winbody')
				});
			})
		}
		$(function() {

			$.ajax({
				url: API+'/erpManagement/gojianceweihu?custId=' + loadUserInfo.user.id,
				type: 'get',
				dataType: 'json',
				success: function(ret) {
					var obj = ret.data
					var html = '';

					for(var key in obj) {
						html += '<li onclick="seeInfo(' + obj[key].id + ')">' +
							'<a>' +
							'' + obj[key].cusName + '' +
							'</a>' +
							'</li>';
					}
					$("#list").html(html);
				},
				error: function(err) {
					alert("系统错误");

				}
			});

		})
	</script>